<?php echo "<h1>".$this->escape($this->title)."</h1>";?>
 <table id='filmy'>
  <tr>
      <th>id</th>
      <th>Tytuł</th>
      <th>Miniatura</th>
      <th>Opis</th>
      <th>Źródło</th>
      <th>Gatunek</th>
      <th>Typ</th>
      <th>&nbsp;</th>
 </tr>
 <?php foreach($this->films as $user) : ?>
 <?php $db = Zend_Db_Table::getDefaultAdapter();
        $query = $db->select()
                ->from('genres', 'genre')
                ->where('idgenre = ?', $user->idgenre);
        $result = $db->fetchRow($query);

        $user->idgenre = $result['genre'];
        
        
        $querytyp = $db->select()
                ->from('movietype', 'movietype')
                ->where('idmovietype = ?', $user->idmovietype);
        $resulttyp = $db->fetchRow($querytyp);
        
        $user->idmovietype =$resulttyp['movietype'];
        
        ?>
 <tr>
     <td><?php echo $this->escape($user->idmovie);?></td>
     <td><?php echo $this->escape($user->title);?></td>
     <td><?php echo $this->escape($user->miniature);?></td>
     <td><?php echo $this->escape($user->description);?></td>
     <td><?php echo $this->escape($user->source);?></td>
     <td><?php echo $this->escape($user->idgenre);?></td>
     <td><?php echo $this->escape($user->idmovietype);?></td>
     <td>
         <a href="<?php echo $this->url(array('controller'=>'zalogowani', 
             'action'=>'edytujfilm', 'idmovie'=>$user->idmovie));?>">Edit</a>
         <a href="<?php echo $this->url(array('controller'=>'zalogowani', 
             'action'=>'usunfilm', 'idmovie'=>$user->idmovie));?>">Delete</a>
     </td>
 </tr>
 <?php endforeach; ?>
 </table>
<h3 id="podtytul"><a href="<?php echo $this->url(array('controller'=>'zalogowani',
         'action'=>'dodajfilm'));?>">Dodaj nowy</a></h3>

